from django.db import models
from common.constants import LEN_NORMAL, LEN_X_LONG, LEN_LONG

# Create your models here.

from django.db import models
from common.model_base import Base


class Algorithm(Base):
    name = models.CharField('算法名称', max_length=LEN_NORMAL)
    desc = models.CharField('算法简介', max_length=LEN_X_LONG)
    img_url = models.CharField("图片路径", null=True, blank=True, max_length=LEN_NORMAL)

    class Meta:
        verbose_name = '机器学习算法'
        verbose_name_plural = '机器学习算法'


class Image(models.Model):
    img_url = models.ImageField('图片路径', upload_to="algorithm/", null=True, blank=True)

    class Meta:
        verbose_name = '图片地址'
        verbose_name_plural = '图片地址'
